import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Test3 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int T = scanner.nextInt();

        for (int t = 0; t < T; t++) {
            int n = scanner.nextInt();
            int x = scanner.nextInt();

            List<Integer>[] graf = new ArrayList[n+1];

            for (int i = 1; i <= n; i++) {
                graf[i] = new ArrayList<>();
            }
            for (int i = 1; i < n; i++) {
                int u = scanner.nextInt();
                int v = scanner.nextInt();
                graf[u].add(v);
                graf[v].add(u);
            }
            if(graf[x].size() <=1){
                System.out.println("Xiaoyo");
            }else {
                System.out.println((n%2 ==0)?"Pyrmout":"Draw");
            }
        }
    }
}
